<template>
  <a-layout class="layout main">
    <a-layout-header class="acea-row row-middle"> 
      <div class="logo" />
      <a-menu
        theme="dark"
        mode="horizontal"
        v-model:selectedKeys="selectedKeys"
        :style="{ lineHeight: '64px',flex:1 }"
      >
        <a-menu-item key="1">单图模式</a-menu-item>
        <a-menu-item key="2">文件模式</a-menu-item>
      </a-menu>
      <Icon @click="showDrawer = true" icon="SettingOutlined" size="18" style="color:#ffffff;cursor: pointer;" />
    </a-layout-header>
    <a-layout-content style="padding: 0 50px">
      <div style="margin: 16px 0"></div>
      <!-- <div :style="{ background: '#fff', padding: '24px', minHeight: '280px' }">Content</div> -->
      <One :quality="quality" v-if="selectedKeys == 1" />
      <file :quality="quality" v-else />
    </a-layout-content>
    <a-layout-footer style="text-align: center">
      <a class="acea-row row-center" href='https://gitee.com/cyx312660145/picture-yasuo/stargazers'>
        <img style="width:75px;height:21px;" src='https://gitee.com/cyx312660145/picture-yasuo/badge/star.svg?theme=dark' alt='star' />
      </a>
    </a-layout-footer>
    <a-drawer
      title="配置参数"
      placement="right"
      :closable="false"
      :visible="showDrawer"
      width="360"
      @close="showDrawer = false"
    >
      <a-form >
        <a-form-item label="品质">
          <a-slider v-model:value="quality" :max="1" :min="0.1" :step="0.1" style="margin-top:11px"/>
        </a-form-item>
      </a-form>
    </a-drawer>
  </a-layout>
</template>

<script>
import { defineComponent, reactive, ref } from 'vue';
import One from './components/one'
import File from './components/file'
import Icon from 'components/icon'
export default defineComponent({
  setup() {
    return {
      showDrawer:ref(false),
      selectedKeys: ref(['1']),
      quality:ref(0.8),
      labelCol: {
        span: 4,
      },
      wrapperCol: {
        span: 14,
      },
    };
  },
  components:{
    One,
    File,
    Icon
  }
});
</script>

<style scoped>
.main{
  min-height: 100vh;
  max-width: 1140px;
  margin: auto;
}
.site-layout-content {
  min-height: 280px;
  padding: 24px;
  background: #fff;
}
#components-layout-demo-top .logo {
  float: left;
  width: 120px;
  height: 31px;
  margin: 16px 24px 16px 0;
  background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl #components-layout-demo-top .logo {
  float: right;
  margin: 16px 0 16px 24px;
}

[data-theme='dark'] .site-layout-content {
  background: #141414;
}
</style>